package ru.rchervot.sanasar.client.view;

import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public abstract class AbstractRecordEditView extends AbstractContentView {
	
	private final Widget newCardWidget;
	private final VerticalPanel newCardPanel = new VerticalPanel();
	
	public AbstractRecordEditView(Widget newCardWidget) {
		super();
		
		this.newCardWidget = newCardWidget;
		
		newCardPanel.add(newCardWidget);
		newCardPanel.setVisible(true);
		
		newCardPanel.setSize("100%", "100%");
		basePanel.add(newCardPanel);
	}
	
	public void onWindowResized(int width, int height) {
		// typical where you have some widget beneath the SP

//		int scrollerHeightItem = height - MainView.kHeaderHeight - MainView.kModuleHeaderHeight - AbstractSecondNorthSearchWidget.HEIGHT_PX 
//		- AbstractItemViewHeaderWidget.HEIGHT_PX - ACTIONS_HEIGHT_PX - 7;
//		int scrollerHeightResults = height - MainView.kModuleHeaderHeight - AbstractSecondNorthSearchWidget.HEIGHT_PX 
//		- ACTIONS_HEIGHT_PX - 7;
//		
//		if (scrollerHeightItem < 1) scrollerHeightItem = 1;
//		if (scrollerHeightResults < 1) scrollerHeightResults = 1;
//		
//		recordPanel.setHeight(scrollerHeightItem + "px");
//		resultsPanel.setHeight(scrollerHeightResults + "px");

		// System.out.println("scrollerHeight: " + scrollerHeight);
	}
	
}
